# 示例 Pydantic 模式
from pydantic import BaseModel
from typing import Optional
from datetime import datetime

class ExampleBase(BaseModel):
    """示例基础模式"""
    name: str
    description: Optional[str] = None

class ExampleCreate(ExampleBase):
    """创建示例的请求模式"""
    pass

class ExampleUpdate(BaseModel):
    """更新示例的请求模式"""
    name: Optional[str] = None
    description: Optional[str] = None

class ExampleResponse(ExampleBase):
    """示例响应模式"""
    id: int
    is_active: bool
    created_at: datetime
    updated_at: Optional[datetime] = None

    class Config:
        from_attributes = True 